﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace InitiativeTracker
{
    public class EntryHelper
    {
        TextBox textBox;
        Label label;

        public EntryHelper()
        {
            Init("Test" , new Point(20,30));
        }
        public EntryHelper(string name, Point location)
        {
            Init(name, location);
        }
        void Init(string name , Point location )
        {
            label = new System.Windows.Forms.Label();
            label.AutoSize = true;
            label.BackColor = System.Drawing.Color.Transparent;
            label.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F);
            label.Name = name;
            label.TabIndex = 4;
            label.Text = name;
            label.MaximumSize = new Size(5000,5000);
            
            

            textBox = new System.Windows.Forms.TextBox();
            textBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F);
            textBox.Name = name;
            textBox.MaximumSize = new Size(5000,5000);
            textBox.Size = new System.Drawing.Size(252, 0);
            textBox.TabIndex = 16;
            textBox.Text = name;
            
            textBox.TextAlign = HorizontalAlignment.Left;
            SetLocation(location.X, location.Y);
        }

        public void SetLocation(int x , int y)
        {
            label.Location = new System.Drawing.Point(x, y);
            textBox.Location = new System.Drawing.Point(label.PreferredWidth + x, y - 2);
        }

        public void SetSize(int width, int height)
        {
            textBox.Size = new System.Drawing.Size(width, height);
        }

        public void SetLabel(string label)
        {
            this.label.Name = label;
            this.label.Text = label;
        }

        public void SetTabIndex(int index)
        {
            textBox.TabIndex = index;
        }

        public TextBox TEXTBOX
        {
            get { return textBox; }
        }

        public Label LABEL
        {
            get { return label; }
        }
    }
}
